import request from '@/utils/request'
import { downFile } from '@/utils/request'

/**
 * 位置表分页查询
 * @param {查询条件} data
 */
export function listLayPosition(query) {
  return request({
    url: 'business/LayPosition/list',
    method: 'get',
    params: query,
  })
}

/**
 * 位置表tree查询
 * @param {查询条件} data
 */
export function treelistLayPosition(query) {
  return request({
    url: 'business/LayPosition/treelist',
    method: 'get',
    params: query,
  })
}
/**
 * 新增位置表
 * @param data
 */
export function addLayPosition(data) {
  return request({
    url: 'business/LayPosition',
    method: 'post',
    data: data,
  })
}
/**
 * 修改位置表
 * @param data
 */
export function updateLayPosition(data) {
  return request({
    url: 'business/LayPosition',
    method: 'PUT',
    data: data,
  })
}
/**
 * 获取位置表详情
 * @param {Id}
 */
export function getLayPosition(id) {
  return request({
    url: 'business/LayPosition/' + id,
    method: 'get'
  })
}

/**
 * 删除位置表
 * @param {主键} pid
 */
export function delLayPosition(pid) {
  return request({
    url: 'business/LayPosition/delete/' + pid,
    method: 'POST'
  })
}
// 导出位置表
export async function exportLayPosition(query) {
  await downFile('business/LayPosition/export', { ...query })
}
